<template>
	<view class="big-box">
		<NavBar title="设置中心" />
		<view class="opacList">
			<view class="opacItem" @click="jump('/my/personal')">
				<text>帮助中心</text>
				<uni-icons color="#999999" type="forward" size="15"></uni-icons>
			</view>
			<view class="opacItem" @click="jump('/my/payPassword')">
				<text>联系我们</text>
				<text class="phone">400-820-8820</text>
				<uni-icons color="#999999" type="forward" size="15"></uni-icons>
			</view>
		</view>

		<view class="loginOutBtn" @click="layOutLogin">退出登录</view>
	</view>
</template>

<script>
export default {
	data() {
		return {};
	},
	methods: {
		jump(url) {
			uni.navigateTo({
				url
			});
		},

		// 退出登录
		async layOutLogin() {
			try {
				// let { data } = await this.$request({
				// 	url: 'layOutLogin',
				// 	method: 'delete'
				// });
				// let { data1 } = await this.$request({
				// 	url: 'layOut',
				// 	method: 'delete'
				// });
				uni.removeStorageSync('token');
				uni.showToast({
					title: '退出登录成功',
					icon: 'none',
					success() {
						setTimeout(() => {
							uni.switchTab({
								url: '/pages/tab/home'
							});
						}, 1500);
					}
				});
			} catch (e) {
				console.log(e);
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.big-box {
	min-height: 100vh;
	background-color: #e6f8f7;
	overflow: hidden;
}

.opacList {
	margin-top: 20rpx;
	padding: 0 30rpx;
	background: #ffffff;
	.opacItem {
		padding: 30rpx 0;
		border-bottom: 2rpx solid #f6f6f6;
		display: flex;
		justify-content: space-between;
		font-weight: bold;
		font-size: 30rpx;
		color: #333333;
		.phone {
			margin-left: auto;
			margin-right: 20rpx;
			font-weight: 500;
			font-size: 30rpx;
			color: #999999;
		}
	}
}

.loginOutBtn {
	margin: 80rpx auto;
	width: 690rpx;
	height: 88rpx;
	line-height: 88rpx;
	background: #85dcd6;
	border-radius: 44rpx;
	text-align: center;
	font-weight: bold;
	font-size: 34rpx;
	color: #333333;
}
</style>
